package 书类;

public class Book implements Comparable{

	 String name;  
	 double price;  
	 public Book(String name,double price) {  
	 this.name=name;  
	 this.price=price;  
	  
	 }  
	    public int compareTo(Object b) {  
	         Book book=( Book)b;  
	        return (int) (this.price-book.price);  
	          
	    }  

}
